﻿
namespace iTunesSync
{
    static class Settings
    {
        private static string startupPath;
        private static string iniSettingsPath;

        public static void setPath(string path)
        {
            startupPath = path + "\\";
            iniSettingsPath = startupPath + "appSettings.ini";
            //
            if (!System.IO.File.Exists(iniSettingsPath)) { System.IO.File.Create(iniSettingsPath); }
            //
            clearValues();
        }

        private static void clearValues()
        {
            d_syncPath = null;
        }

        #region Settings

        private static string d_syncPath;
        public static string syncPath
        {
            get
            {
                if (d_syncPath != null) { return d_syncPath; }
                else { return new IniFile(iniSettingsPath).GetString("Settings", "SyncPath", ""); }
            }
            set { new IniFile(iniSettingsPath).WriteValue("Settings", "SyncPath", value); d_syncPath = value; }
        }

        #endregion
    }
}
